package top.tervest.easyshare.common.exception;

import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import top.tervest.easyshare.common.Result;
import top.tervest.easyshare.common.constant.ResponseState;

/**
 * 全局异常处理
 * @author ZhangNanNan
 * @create 2019-07-17 14:57
 */
@ControllerAdvice
@Log4j2
public class CustomExceptionHandler {

//    @ExceptionHandler(Exception.class)
//    @ResponseBody
//    public Result handleException(Exception e){
//        log.error(e.getMessage());
//        return Result.failure(ResponseState.ERROR,"服务出错!");
//    }

}
